package edu.ccut.saturn.studio.database.popup.action;

import java.util.List;


import edu.ccut.saturn.studio.core.util.action.SaturnAction;
import edu.ccut.saturn.studio.core.util.eclipse.SaturnDialogUtil;
import edu.ccut.saturn.studio.database.model.SaturnTree;
import edu.ccut.saturn.studio.database.ui.DBConnectView;

/**
 * 刷新连接
 * 
 * @author 谷钰
 * @version 1.0 2008.12.06
 * 
 */
public class RefreshAction extends SaturnAction {
	
	public void run() {
		List<SaturnTree> selecteds = DBConnectView.getInstance().getCurrentSelections();
		try {
			for (SaturnTree selected : selecteds) {
				DBConnectView.getInstance().expand(selected);
			}
		} catch (Exception e) {
			SaturnDialogUtil.openError(super.getShell(),
					"Refresh Connection Error!:" + e.getMessage());
		}
	}
}
